import KoaRouter from 'koa-router';
const router = new KoaRouter({ prefix: '/sys/role' });
import { auth, hadAdminPermission } from '../middleware/auth.middleware';
import { verifyPageSize } from '../middleware/pagesize.middleware';
import { roleValidator, verifyRole } from '../middleware/role.middleware';
import RoleController from '../controller/role.controller';

router.use(auth);
router.use(hadAdminPermission);

//创建新增
router.post('/create', roleValidator,verifyRole,RoleController.create)
//删除
router.delete('/delete',RoleController.delete)
//修改
router.put('/update',RoleController.update)
//查询
router.get('/queryList', verifyPageSize,RoleController.queryList)

export default router;